﻿<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:ErrisyDemo"
    xmlns:e="clr-namespace:Errisy;assembly=Errisy"
    Title="MainWindow" Height="350" Width="525">
    <!--<Grid>
        <e:MultipleCanvasItemsControl Name="dicMain">
            <e:ItemsSourceProvider ItemsSource="{Binding Tests}"/>
            <e:ItemsSourceProvider ItemsSource="{Binding Demos}"/>
            <e:MultipleCanvasItemsControl.ItemTemplateSelector>
                <e:DirectTypeTemplateSelector>
                    <DataTemplate DataType="{x:Type my:TestObject}">
                        --><!--<Border e:CanvasEditor.Left="{Binding X}" e:CanvasEditor.Top="{Binding Y}" Background="Blue" Width="20" Height="20"/>--><!--
                        <e:CanvasForm Header="{Binding Path=Value}" e:CanvasEditor.Left="{Binding X}" e:CanvasEditor.Top="{Binding Y}"/>
                        --><!--<Line X1="800" Y1="100" X2="{Binding X}" Y2="{Binding Y}" Stroke="Blue"/>--><!--
                    </DataTemplate>
                    <DataTemplate DataType="{x:Type my:DemoObject}">
                        --><!--<Ellipse e:CanvasEditor.Left="{Binding X}" Fill="Red" e:CanvasEditor.Top="{Binding Y}" Width="{Binding Path=Width}" Height="{Binding Path=Height}"/>--><!--
                        <Border e:CanvasEditor.Left="{Binding X}" e:CanvasEditor.Top="{Binding Y}" Background="Blue" Width="240" Height="240"/>
                    </DataTemplate>
                </e:DirectTypeTemplateSelector>
            </e:MultipleCanvasItemsControl.ItemTemplateSelector>
        </e:MultipleCanvasItemsControl>
    </Grid>-->
    <Grid>

        <Grid.RowDefinitions>
            <RowDefinition Height="24"></RowDefinition>
            <RowDefinition />
        </Grid.RowDefinitions>
        <Button Name="btn" Click="ttt">
        </Button>
        <e:DirectItemsControl Name="icMain" Grid.Row="1">
            <e:DirectItemsControl.Template>
                <ControlTemplate TargetType="{x:Type e:DirectItemsControl}">
                    <Border Background="{TemplateBinding Background}" >
                        <e:DirectItemsPresenter Grid.Column="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </Border>
                </ControlTemplate>
            </e:DirectItemsControl.Template>
            <e:DirectItemsControl.ItemsPanel>
                <DataTemplate>
                    <WrapPanel/>
                </DataTemplate>
            </e:DirectItemsControl.ItemsPanel>
            <e:DirectItemsControl.ItemTemplate>
                <DataTemplate>
                    <Grid MinWidth="20">
                        <Grid>
                            <Grid.Style>
                                <Style TargetType="Grid">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Test}" Value="True">
                                            <Setter   Property="Visibility" Value="Visible"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding Test}" Value="False">
                                            <Setter   Property="Visibility" Value="Hidden"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Grid.Style>
                            <Button>
                                Name
                            </Button>
                        </Grid>
                    </Grid>

                </DataTemplate>
            </e:DirectItemsControl.ItemTemplate>
        </e:DirectItemsControl>
    </Grid>
</Window>
